<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
<script type="text/javascript">
function checkForm(){
    var comment=$("#comment").val();
    var status = $("#leaveStatus").val();
    if(comment=="" && status =="rejected")
        {
            alert("please put your comment for your decision"+status);
            return false;
        }
    else{

        alert("Good"+status);
        return true;
        }
    
}; 
</script>
<title>Insert title here</title>
</head>
<body>
<form:form commandName="leavedetail" name="selectstatus" onsubmit="return checkForm();" >
<table class="table table-striped table-hover">
	<tr>
		<a href="${pageContext.request.contextPath}/staffHome/leavelist/${leavedetail.users.id}">View Leave History</a>
	</tr>
	<tr>
		<td>RefNo</td>
		<td><c:out value="${leavedetail.refNo}"/></td>
	</tr>
	<tr>
		<td>EmployeeID</td>
		<td><c:out value="${leavedetail.users.id}"/></td>
	</tr>
	<tr>
		<td>Name</td>
		<td><c:out value="${userforleaverecord.name}"/></td>
	</tr>
	<tr>
		<td>Designation</td>
		<td><c:out value="${userforleaverecord.designation}"/></td>
	</tr>
	<tr>
		<td>Contact No</td>
		<td><c:out value="${userforleaverecord.contact}"/></td>
	</tr>
	<tr>
		<td>Address</td>
		<td><c:out value="${userforleaverecord.address}"/></td>
	</tr>
	<tr>
		<td>LeaveType</td>
		<td><c:out value="${leavedetail.leaveType}"/></td>
	</tr>
		<tr>
		<td>FromDate</td>
		<td><c:out value="${leavedetail.leaveStart}"/></td>
	</tr>
	<tr>
		<td>ToDate</td>
		<td><c:out value="${leavedetail.leaveEnd}"/></td>
	</tr>
	<tr>
		<td>Additional Reason</td>
		<td><c:out value="${leavedetail.additionalReason}"/></td>
	</tr>
	<tr>
		<td>Work Dissemination</td>
		<td><c:out value="${leavedetail.workDissemination}"/></td>
	</tr>
	<tr>
		<td>Contact Detail</td>
		<td><c:out value="${leavedetail.workDissemination}"/></td>
	</tr>
	<tr>
		<td>Comment</td>
		<td><form:input path="comment" width="100px" height="50px" /></td>
	</tr>
	<tr>
		<td>Leave Status</td>
		<td> <form:select path="leaveStatus" >  
                
                <form:option value="rejected">rejected</form:option>  
                <form:option selected="selected" value="approved">approved</form:option>  
                
            </form:select></td>
	</tr>
	<tr>
		<td></td> 	
		<td><input type="submit" class="btn btn-default" value="Summit"/></td>
	</tr>
	
	</table>
		</form:form>

	
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</body>
</html>